{% extends "base.html" %} {% block content %}
<div class="posts">
    {% if error %}
    <h2 class="post-title">没有相关文章题目</h2> {% else %} {% for post in post_list %}
    <section class="post">
        <header class="post-header">
            <h2 class="post-title"><a href="{% url 'detail' id=post.id %}">{{ post.title }}</a></h2>

            <p class="post-meta">
                Time: <a class="post-author" href="#">{{ post.date_time |date:'Y /m /d'}}</a>&nbsp&nbsp Category: <a class="post-category post-category-pure" href="{% url 'search_tag' tag=post.category %}">{{ post.category }}</a>&nbsp&nbsp Tag: {% for tag in post.tag.all %}
                <a class="post-category post-category-pure" href="#">{{ tag }}</a> {% endfor %}
            </p>
        </header>
    </section>
    {% endfor %} {% endif %}
</div>
<!-- /.blog-post -->
{% endblock %}
